Skip to content

Preserve explicit Monitor Todo selection in quota polling - #9099

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/fix-monitor-poll-target-admission-20261119
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/fix-monitor-poll-target-admission-20261119

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

#9093 lets a caller observe a secondary due Monitor by supplying its Todo ID. The CLI also resolves a target key to a Todo internally for receipts. That derived ID could select a different due Monitor even when the caller supplied only its target key.

The quota decision now carries whether the Todo ID was supplied explicitly. A key alone must match the scheduled Monitor. An explicit ID can still identify another due Monitor claimed by the same Agent, subject to existing gates. Pending transactions retain their frozen admission when the receipt matches the original effect.

The patch also removes the unused Markdown renderer forwarding and the wrapper around the shared clock. The lookback smoke now uses an isolated fixture registry.

Author declaration

Criterion Disposition Owner Evidence
Match the scheduled Monitor by key and preserve both records on rejection Implemented monitor_poll_admission.ts File and SQLite public CLI cases
Admit an explicit secondary Todo subject to due, claim and User gates Implemented monitor_poll_admission.ts Public CLI and native admission cases
Preserve original authority on retry Implemented monitor_poll_commit.ts Frozen receipt regression and lease recovery cases

Scope and continuation

This fixes quota Monitor admission independently of Chat. The same Monitor smoke passes in a local composition with #8717 at d1668e0e9ada. That Chat PR still needs review of its current head.

Validation

  • Tested 77da4e2f8e43d531cc3ddb9ef1553120a2993440 against 477def5c176ab4df92ac19ea1dd616828b325e87.
  • Run state finished. Input classes synthetic and public_fixture.
Check Result Evidence
regression_parity passed Main accepted the alternate target key. The candidate rejected it without changing either Todo and accepted the explicit ID.
real_entrypoint and real_backend passed Full monitor-poll-writeback-smoke.py on the candidate and combined Chat tree. File and SQLite canonical CLI cases covered selection, writeback and receipt recovery.
integration passed 100 focused Python cases and 96 TypeScript Monitor and Steward cases.
static passed Control-plane TypeScript typecheck, Ruff on the changed Python files, and RFC bilingual diff check.
integration passed All six direct and 19 selected local premerge checks.
static failed Required repository Ruff and kernel mypy report identical findings on main and this head. The merge gate remains held. See #9082.

Frontend and visual evidence

  • UI impact none. This change affects admission on the existing CLI route.
  • Source data none.

Type and area

  • Bug fix
  • Documentation and test update
  • Control plane

Boundary checklist

  • Diff and evidence contain public-safe code and isolated fixture results.
  • Scope stays within Monitor admission and its validation.
  • No paired RFC changed. The bilingual diff check passed.
  • The commit carries DCO sign-off.

Carry Todo selection provenance into quota admission. Preserve explicit secondary Monitor polling and recovery from previously admitted receipts.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

对到期 continuous_monitor 进行观察时,调度器已经选定一条 Todo。另一条 Monitor 的 key 曾可替换当前选择。自动选择应保持稳定,明确指定到期次要 Todo 的现有操作也应继续可用。本切片负责本地准入及冻结事务,Chat 的 #8717 保留独立验收。

改动思路 / Approach

Python 保留调用中是否显式提供 Todo ID 的布尔事实。TypeScript 的既有 Monitor admission 比较调度选定项、到期列表与明确指定目标。原冻结事务仍用自己的准入记录恢复。入口解析到现有 canonical Monitor admission 的小范围改动,无新状态来源。握住原始请求的新旧差异,并让已准入操作按保存的 decision 继续。

具体改动 / Changes

精确 head 77da4e2f8e43d531cc3ddb9ef1553120a2993440,diff base 477def5c176ab4df92ac19ea1dd616828b325e87,7 个文件 +134/-33。逐项复核 attempt_due_monitor、quota.monitor_poll.commit。验收约定

关键代码讲解

  • 显式性在 CLI 来源仍可区分时写入。源码
  • 只约束当前 lane 的 secondary fallback。源码
  • 从已冻结 admission 恢复旧 effect 的实测。当 pending receipt 缺失新字段时,相同输入仍获得原 provider plan,已有合法业务结果可以继续落盘和读回。源码

对主干的风险 / Risks

两个后端的候选均拒绝该请求,cursor 和两条 Todo 不变。显式次要 Todo ID 与已选 key 分别成功,且每次只更新对应一项。 错配的 ID 与 key 在 base/head 都拒绝。TS 复验未到期、不同 claim 和 User gate 的拒绝,以及旧 pending receipt 的恢复。

语义与 CI 对齐

44 项真实 CLI 与集成测试、25 项 TypeScript 事务测试、完整候选 Monitor smoke、变更 Python Ruff、RFC 双语差分及 diff 检查均通过。 本地 File、SQLite 的原生 CLI 和冻结事务已验证。#8717 组合证据来自作者,托管 CI 状态未知。 配置的 Ruff 和 mypy 在 base/head 报告逐字相同,合入仍受这两项检查约束。 主干问题 #9082

我的整体评价 / Verdict

代码评审通过。File 与 SQLite 的选择与恢复符合当前合同。此前已在主干出现的 Ruff 和 mypy 检查仍待处理,合入由维护者决定。

English verdict: APPROVE. Approve the exact-head code change. The unchanged repository lint and typecheck failures remain a merge hold.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant